package org.example.util;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

//@ControllerAdvice
public class ExceptionUtils {

  //  @ExceptionHandler(Exception.class)
    public ResponseEntity<Object> handleException(Exception e){
      //  e.printStackTrace();
        ResponseEntity<String> stringResponseEntity = new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
        return new ResponseEntity<>("全局异常拦截", HttpStatus.INTERNAL_SERVER_ERROR);
    }

}
